package calculatorEngine;

//Pawel, 28.11.2013, 21:30

public class SeatConfiguration {
	
	//dwuwymiarowa tablica reprezentujaca uklad siedzen
	//indexowanie zaczyna sie od 0, jak cos :)
	private SeatButton[][] arrayOfSeats;
	
	private int seatRows;
	private int seatColumns;
	
	public SeatConfiguration(int seatColumn, int seatRow) {
		
		 arrayOfSeats = new SeatButton[seatColumn][seatRow];
		
		for (int iC = 0; iC < seatColumn; iC++) {
			
			for (int iR = 0; iR < seatRow; iR++) {
				
				arrayOfSeats[iC][iR] = new SeatButton();
				
			}
			
		}
		
		this.setSeatRows(seatRow);
		this.setSeatColumns(seatColumn);
		
	
	 }
	public void seatIsTaken(int row, int column) {
		
		arrayOfSeats[row -1][column -1].getSeat().setStatus(Seat.TAKEN);
		
	}
	
	public void seatIsFree(int row, int column) {
		
		arrayOfSeats[row][column].getSeat().setStatus(Seat.FREE);
		
	}
	
	public SeatButton[][] getSeatsArray() {
		
		return arrayOfSeats;
		
	}

	public void setSeatRows(int seatRows) {
		this.seatRows = seatRows;
	}

	public int getSeatRows() {
		return seatRows;
	}

	public void setSeatColumns(int seatColumns) {
		this.seatColumns = seatColumns;
	}

	public int getSeatColumns() {
		return seatColumns;
	}
	

}
